package practice7;

import java.util.Scanner;

public class P8 {

	static long n;
	//a��bС
	public static long C(long a,long b) {
		long res=1;
	    for(long i=a,j=1;j<=b;i--,j++) {
	    	res=res*i/j;
	    }
	    return res;
	}
	
	public static void check(int x) {
		long l=2*x,r=Math.max(n,l);
		while(l<=r) {
			long mid=(l+r)/2;
			long num=C(mid,x);
			if(num==n) {
				long ans=mid*(mid+1)/2+x+1;
				System.out.println(ans);
				System.exit(0);
			}else if(num>n) {
				r=mid-1;
			}else if(num<n) {
				l=mid+1;
			}
		}
	}
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		n=sc.nextLong();
		if(n==1) {
			System.out.println(1);
		}
		for(int i=15;i>0;i--) {
			//������1~15��б��,б�ߵ���ʼֵΪC2i i;
			check(i);
		}
	}
}
